import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:yh_core_flutter_project/project/base/base_test_page.dart';
import 'package:yh_core_flutter_project/project/base/empty_state_example_page.dart';
import 'package:yh_core_flutter_project/project/modules/common/others/pages/debug_page.dart';
import 'package:yh_core_flutter_project/project/modules/common/others/pages/not_found_page.dart';
import 'package:yh_core_flutter_project/project/modules/common/others/pages/welcome_page.dart';
import 'package:yh_core_flutter_project/project/modules/common/webview/pages/yh_webview_page.dart';
import 'package:yh_core_flutter_project/project/modules/login/pages/email_code_page.dart';
import 'package:yh_core_flutter_project/project/modules/login/pages/login_page.dart';
import 'package:yh_core_flutter_project/project/modules/login/pages/login_logic.dart';
import 'package:yh_core_flutter_project/project/modules/login/pages/sign_up_page.dart';

import 'package:yh_core_flutter_project/project/modules/mine/pages/smart_dialog_test_page.dart';
import 'package:yh_core_flutter_project/project/modules/main_tab/main_tab_page.dart';


import '../common/managers/user_manager.dart';

part 'app_pages.dart';

enum AppRouters {
  ///欢迎页
  welcome,

  ///登录
  login,

  ///注册
  signUp,

  ///mainTab
  mainTab,

  ///管理房间
  manageRooms,

  ///邀请信息
  inviteInformation,

  ///邮箱验证码
  emailCode,

  ///Base测试页面
  baseTest,

  ///登录示例页面
  emptyExample,

  ///存储测试页面
  storageTest,

  ///SmartDialog测试页面
  smartDialogTest,

  ///调试页面
  debug,

  ///webView
  webView,
}

extension AppRoutersPage on AppRouters {
  Widget get pageWidget {
    switch (this) {
      case AppRouters.welcome:
        return WelcomePage();
      case AppRouters.login:
        return LoginPage();
      case AppRouters.signUp:
        return SignUpPage();
      case AppRouters.mainTab:
        return MainTabPage();
      case AppRouters.emailCode:
        return EmailCodePage();
      case AppRouters.baseTest:
        return BaseTestPage();
      case AppRouters.emptyExample:
        return EmptyStateExamplePage();
      case AppRouters.smartDialogTest:
        return SmartDialogTestPage();
      case AppRouters.debug:
        return DebugPage();
      case AppRouters.webView:
        return YHWebViewPage();
      default:
        return NotFoundPage();
    }
  }
}
